<template>
	<view style="overflow-x: hidden;">
		<view class="bg">
			<image class="bg-img" src="/static/vip/bg.png" mode=""></image>
		</view>
		
		<view class="nav" :style="{ paddingTop: statusBarHeight + 'px' }">
			<image class="nav-back"  mode="" @click="back"></image>
			<text class="nav-title">会员中心</text>
			<view class="nav-space"></view>
		</view>
		
		<view class="info" :style="{marginTop: statusBarHeight + 44 + 'px'}">
			<image class="info-bg" :src="config.vip_bj" mode=""></image>
			
			<view class="info-content">
				<view class="info-avatar">
					<image class="info-avatar-pic" :src="userInfo.avatar" mode=""></image>
				</view>
				<view class="info-name">
					<text class="info-name">{{userInfo.nickname}}</text>
					<text class="info-level">淄博城市发展合伙人礼遇待遇服务卡</text>
				</view>
			</view>
			
			<view class="info-asset">
				<view class="info-asset-item">
					<text class="iai-title">单位</text>
					<text class="iai-value">{{userInfo.unit}}</text>
				</view>
				<view class="info-asset-item">
					<text class="iai-title">职务</text>
					<text class="iai-value">{{userInfo.position}}</text>
				</view>
				<view class="info-asset-item">
					<text class="iai-title">卡号</text>
					<text class="iai-value">{{userInfo.vip_code}}</text>
				</view>
			</view>
		</view>
		
		<view class="main-title">
			<text></text>
		</view>
		
		<view class="privilege">
			<view class="privilege-item"  hover-class="hover" @click="privilegeClick()">
				<image class="privilege-item-pic" :src="image.sm" mode=""></image>
				<text class="privilege-item-text">扫码登记</text>
			</view>
			<view class="privilege-item"  hover-class="hover" @click="kabao1()">
				<image class="privilege-item-pic" :src="image.yjfk" mode=""></image>
				<text class="privilege-item-text">意见反馈</text>
			</view>
			<view class="privilege-item"  hover-class="hover" @click="privilegeClick()">
				<image class="privilege-item-pic" :src="image.djls" mode=""></image>
				<text class="privilege-item-text">登记历史</text>
			</view>
		</view>
		<view>
			<view>
				<text>尊享信息库</text>
				<text>查看更多</text>
				
			</view>
			<view  v-for="(item, index) in config.category" >
				<image class="privilege-item-pic" :src="item.cdn_image" mode=""></image>
				<text class="">{{item.name}}</text>
				<text class="">{{item.nickname}}</text>
				
			</view>
	
			
		</view>
		

	</view>
</template>

<script>
	const statusBarHeight = uni.getSystemInfoSync().statusBarHeight
	export default {
		data() {
			return {
				statusBarHeight,
				current: 0,
				userInfo:{},
				config:{},
				image:{
					'bj':this.websiteUrl+'images/bj.jpg',
					'sm':this.websiteUrl+'images/saoma.png',
					'yjfk':this.websiteUrl+'images/yjfk.png',
					'djls':this.websiteUrl+'images/djls.png',
					
				}
			}
		},
		methods: {
			rechargeChange(index) {
				this.current = index
			},
			privilegeClick() {
				
				  // 允许从相机和相册扫码
                 uni.scanCode({
                     success: function (res) {
                         console.log('条码类型：' + res.scanType);
                         console.log('条码内容：' + res.result);
                     }
                 });
			},kabao1(){
				uni.switchTab({
					url: '/pages/index/dengji'
				});
			}
		},mounted:function() {
			this.userInfo=uni.getStorageSync('username');
			this.config=uni.getStorageSync('config');
        }
	}
</script>
<style lang="scss" scoped>
   @import './index.scss'
</style>

